﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace WindowsFormsApplication
{
    public partial class ImageForm : Form
    {
        public ImageForm()
        {
            InitializeComponent();
        }

        private void btnLoad_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            if (string.IsNullOrEmpty(openFileDialog1.FileName))
            {
                return;
            }

            Bitmap bm = new Bitmap(openFileDialog1.FileName);
            pictureBox1.Image = bm;
            pictureBox1.Width = bm.Width;
            pictureBox1.Height = bm.Height;
        }
    }
}
